from orm.connet import engine
from entity.user import User
from sqlmodel import Session
from sqlmodel import SQLModel
import service.userService as userService

SQLModel.metadata.create_all(engine)

user = User(name="John", age=30)
with Session(engine) as session:
    session.add(user)
    session.commit()
    session.refresh(user)
print(user.id)
# import sys  
# print(sys.path)
user=userService.find(user.id)
print(user.name)
userService.update(user.id,name="Jim")
user=userService.find(user.id)
print(user.name)
userService.delete(user.id)